__author__ = 'Amin'
import cairo
class Base():
    def set_base_color(self):
        if self.name == "A" and self.isdownstream is False:
            return 250,210,171
        elif self.name == "T" and self.isdownstream is False:
            return 250,210,171
        elif self.name == "C" and self.isdownstream is False:
            return 210,250,171
        elif self.name == "G" and self.isdownstream is False:
            return 210,250,171
        elif self.name == "N" and self.isdownstream is False:
            return 230,230,230
        elif self.name == "A" and self.isdownstream is True:
            return 2150,126,102
        elif self.name == "T" and self.isdownstream is True:
            return 2150,126,102
        elif self.name == "C" and self.isdownstream is True:
            return 147,175,119
        elif self.name == "G" and self.isdownstream is True:
            return 147,175,119
        elif self.name == "N" and self.isdownstream is True:
            return 230, 230, 230
        else:
            return 230, 230, 230

    def __init__(self,cx,name,motif,isdownstream):
        self.cx = cx
        self.name = name
        self.isdownstream = isdownstream
        #cx = cairo.Context()
        cx.set_antialias(cairo.ANTIALIAS_SUBPIXEL)
        (r,g,b) = self.set_base_color()

        cx.set_source_rgb(0,g,b)
        cx.rectangle(10,10,10,10)
        cx.fill()

s = cairo.ImageSurface(cairo.FORMAT_ARGB32,100,100)
c = cairo.Context(s)
Base(c,"G",None,True)
s.write_to_png("text.png")

